/*
 * @Author: Bennty
 * @Date: 2024-11-22 10:15:11
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2024-11-28 10:45:57
 * @Description: 请填写简介
 */
import request from '@/utils/request';
import { QuerySupplierType } from './types';

/** 查询供应商列表 */
export const getSupplierListApi = (data: QuerySupplierType) => {
    return request({
        url: '/system/supplyFactories/list',
        method: 'post',
        data: data
    });
};

/** 新增供应商 */
export const addSupplierApi = (data: any) => {
    return request({
        url: '/system/supplyFactories',
        method: 'post',
        data: data
    });
};

/** 获取供应商详细信息 */
export const getSupplierDetailApi = (id: any) => {
    return request({
        url: `/system/supplyFactories/${id}`,
        method: 'get'
    });
};

/** 修改供应商 */
export const editSupplierApi = (data: any) => {
    return request({
        url: '/system/supplyFactories',
        method: 'put',
        data: data
    });
};

/** 删除供应商 */
export const deleteSupplierApi = (ids: any) => {
    return request({
        url: `/system/supplyFactories/${ids}`,
        method: 'delete'
    });
};

/** 获取供应商列表 不分页 */
export const getSuppliersApi = (type: string)=>{
    return request({
        url: `/system/supplyFactories/getSupplierList`,
        method: 'get',
        params:{
            supplyType: type
        }
    });
};

/** 获取供应商标签 */
export const getSupplierLabelApi = (id: any)=>{
    return request({
        url: `/system/supplyFactories/getLabels`,
        method: 'get',
        params:{
            id: id
        }
    });
};

/** 根据工艺编号查询对应供应商列表 */
export const getSupplierByProcessIdApi = (workProduceId: any) => {
    return request({
        url: '/system/supplyFactories/getSupplierByWorkProcedure',
        method: 'get',
        params: {workProduceId: workProduceId}
    });
};